<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>function函数</title>
   </head>
   <body>
      <script>
         function sum(start = 0, end = 0) {
            let sum = 0;
            for (let i = start; i <= end; i++) {
               sum += i;
            }
            return sum;
         }

         // document.write(sum(1, 100))
         // document.write(`<br>`)
         // document.write(sum())

         (function (){
            document.write('这是一个立即执行函数')
            console.log('这是一个立即执行函数')
            let a = 10
         })();
      </script>
   </body>
</html>